<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/webCommon/webCommon.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>用户修改</title>
<!-- 默认选中学院名称-开始 -->
<script type="text/javascript" >
 $(document).ready(function(){
		$(".collegeIdSelect").each(function(){//循环获取所有单位编号 
			var collegeId = $(this).attr("value");
			var college = $("#sysUserCollegeId").attr("value");
			if(collegeId == college){
				$(this).attr("selected","selected");				
		}	
		});
	 });
</script>
<!-- 默认选中学院名称-结束 -->
<!-- 默认选中专业名称-开始 -->
<script type="text/javascript" >
 $(document).ready(function(){
		$(".marjorsIdSelect").each(function(){//循环获取所有单位编号 
			var marjorsId = $(this).attr("value");
			var marjors = $("#sysUserMarjorsId").attr("value");
			if(marjorsId == marjors){
				$(this).attr("selected","selected");				
		}	
		});
	 });
</script>
<!-- 默认选中专业名称-结束 -->
<!-- 默认选中班级名称-开始 -->
<script type="text/javascript" >
 $(document).ready(function(){
		$(".classIdSelect").each(function(){//循环获取所有单位编号 
			var classId = $(this).attr("value");
			var classIdId = $("#sysUserClassId").attr("value");
			if(classId == classIdId){
				$(this).attr("selected","selected");				
		}	
		});
	 });
</script>
<!-- 默认选中班级名称-结束 -->
<!-- 默认选中组名名称-开始 -->
<script type="text/javascript" >
 $(document).ready(function(){
		$(".strudentGroupIdSelect").each(function(){//循环获取所有单位编号 
			var studentGroupId = $(this).attr("value");
			var studentGroup = $("#sysUserStudentGroupId").attr("value");
			if(studentGroupId == studentGroup){
				$(this).attr("selected","selected");				
		}	
		});
	 });
</script>
<!-- 默认选中组名名称-结束 -->
<script type="text/javascript" src="plugins/layui/layui.js"></script>
		<script>
			layui.use(['form', 'layedit', 'laydate'], function() {
				var form = layui.form(),
					layer = layui.layer,
					layedit = layui.layedit,
					laydate = layui.laydate;
				 //监听提交
				form.on('submit(tijiao)', function(data) {
					layer.alert(JSON.stringify(data.field), {
						title: '最终的提交信息'
					})
				});
			});
		</script>
</head>

<body>
	<div style="margin: 15px;">
		 <form class="layui-form" action="<%=path %>/sys/SysUser_update.action">
		 <li>  <input name="id" type="hidden" value="${sysUser.id }"/></li>
		 <li>  <input name="userId" type="hidden" value="${sysUser.userId }"/></li>
		 <div class="layui-form-item">
				<label class="layui-form-label">类型</label>
				<div class="layui-input-block">
					<input type="radio" name="userType" value="0" title="学生" <c:if test="${0 == sysUser.userType}">checked="checked"</c:if> >
					<input type="radio" name="userType" value="1" title="教师" <c:if test="${1 == sysUser.userType}">checked="checked"</c:if>> 
					<input type="radio" name="userType" value="9" title="管理员" <c:if test="${9 == sysUser.userType}">checked="checked"</c:if>> 
					<!-- <input type="radio" name="sex" value="禁" title="禁用" disabled=""> -->
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">学号</label>
				<div class="layui-input-inline">
					<input type="text" name="userNo" lay-verify="userNo" value="${sysUser.userNo }" autocomplete="off" placeholder="这里输入登录账号" class="layui-input">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">密码</label>
				<div class="layui-input-inline">
					<input type="password" name="userPassword" lay-verify="userPassword" value="${sysUser.userPassword }"  placeholder="请输入" autocomplete="off" class="layui-input">
				</div>
			</div>
			
			<div class="layui-form-item">
				<label class="layui-form-label">姓名</label>
				<div class="layui-input-inline">
					<input type="text" name="userName" lay-verify="userName" value="${sysUser.userName }" autocomplete="off" class="layui-input">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">昵称</label>
				<div class="layui-input-inline">
					<input type="text" name="userNickname" lay-verify="userNickname" value="${sysUser.userNickname }" autocomplete="off" class="layui-input">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">联系方式</label>
				<div class="layui-input-inline">
					<input type="text" name="userContact" lay-verify="userContact" value="${sysUser.userContact }" autocomplete="off" class="layui-input">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">性别</label>
				<div class="layui-input-block">
					<input type="radio" name="userSex" value="0" title="男" <c:if test="${0 == sysUser.userSex}">checked="checked"</c:if> >
					<input type="radio" name="userSex" value="1" title="女" <c:if test="${1 == sysUser.userSex}">checked="checked"</c:if>> 
					<!-- <input type="radio" name="sex" value="禁" title="禁用" disabled=""> -->
				</div>
			</div>
			<c:if test="${0 == sysUser.userType}">
			<div class="layui-form-item">
				<label class="layui-form-label">所属</label>
					<div class="layui-input-inline">
						<select name="collegeId" id="collegeId">
							<option value="">请选择学院</option>
							<s:iterator value="sysCollegeAllList">
							<option class="collegeIdSelect" value="${collegeId}" id="${collegeId}">${collegeName}</option>
							</s:iterator>
						</select>
					</div>
			
					<div class="layui-input-inline">
						<select name="marjorsId" id="marjorsId">
							<option value="">请选择专业</option>
							<s:iterator value="sysMarjorsAllList">
							<option class="marjorsIdSelect"  value="${marjorsId}" id="${marjorsId}">${marjorsName}</option>
							</s:iterator>
						</select>
					</div>
		        
					<div class="layui-input-inline">
						<select name="classId" id="classId">
							<option value="">请选择班级</option>
							<s:iterator value="sysClassAllList">
							<option  class="classIdSelect" value="${classId}" id="${classId}">${className}</option>
							</s:iterator>
						</select>
					</div>
		        </div>
		         </c:if>
			<%-- <div class="layui-form-item">
					<label class="layui-form-label">所属分组</label>
					<div class="layui-input-inline">
						<select name="studentGroupId" id="studentGroupId">
							<option value="">请选择分组</option>
							<s:iterator value="serviceStudentGroupAllList">
							<option class="strudentGroupIdSelect" value="${studentGroupId}" id="${studentGroupId}">${studentGroupName}</option>
							</s:iterator>
						</select>
					</div>
		    </div> --%>
                <div class="layui-form-item">
					<div class="layui-input-block">
						<button id="tijiao" class="layui-btn" lay-filter="tijiao" lay-submit="">立即提交</button>
						<button type="reset" class="layui-btn layui-btn-primary">重置</button>
					</div>
				</div>
		</form>
		<input name="sysUser.collegeId" type="hidden" id="sysUserCollegeId" value="${sysUser.collegeId}"/>  <!-- 用于下拉选择的读取-学院 -->
		<input name="sysUser.marjorsId" type="hidden" id="sysUserMarjorsId" value="${sysUser.marjorsId}"/>  <!-- 用于下拉选择的读取-专业-->
		<input name="sysUser.classId" type="hidden" id="sysUserClassId" value="${sysUser.classId}"/>  <!-- 用于下拉选择的读取-班级 -->
		<input name="sysUser.studentGroupId" type="hidden" id="sysUserStudentGroupId" value="${sysUser.studentGroupId}"/>  <!-- 用于下拉选择的读取-分组 -->
		
	</div>
</body>
</html>
